-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: lib.infer_dtype with mixed-freq Periods #41526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: lib.infer_dtype with mixed-freq Periods #41526
Conversation
@@ -2343,14 +2367,6 @@ def maybe_convert_objects(ndarray[object] objects, bint try_float=False, | |||
elif util.is_float_object(val): | |||
floats[i] = complexes[i] = val | |||
seen.float_ = True | |||
elif util.is_datetime64_object(val): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated to the rest of the PR, this chunk of code is just redundant with a chunk below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this have any user facing changes?
cdef class PeriodValidator(TemporalValidator): | ||
cdef inline bint is_value_typed(self, object value) except -1: | ||
return is_period_object(value) | ||
cdef bint is_period_array(ndarray[object] values): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you not keep the current PeriodValidator format itself? (e.g. just put this function in validate). this is breaking the pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the same pattern we use for is_datetime_with_singletz_array (and will end up using for is_interval_array in an upcoming PR)
|
kk can you add a note. |
whatsnew added + green |
thanks |
Also adds a convert_period option to lib.maybe_infer_objects